﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/NoLeftMasterPage.master"
    AutoEventWireup="true" CodeFile="StageArea.aspx.cs" Inherits="Pages_StageArea" %>

<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="Server">
    <div class="right_container" id="right_container">
        <div class="right_title">
            <asp:Label ID="lbTitle" runat="server" Text="Label"></asp:Label>
        </div>
        <div class="right_contract">
            <div class="bz">
                备注：地上建筑面积=可售业态地上建筑面积+分摊的不可售业态地上建筑面积；地下建筑面积=分摊不可售业态的地下建筑面积；地上销售面积=可售业态地上销售面积；地下销售面积=可售业态地下销售面积；不可售部分面积按地上可售面积分摊到各可售业态当中；
            </div>
            <asp:ObjectDataSource ID="odsData" runat="server" SelectMethod="GetStageAreaList"
                TypeName="PKURG.CostSplit.Business.BusinessTypeArea" OnSelected="odsData_Selected">
                <SelectParameters>
                    <asp:QueryStringParameter Name="projectStageId" QueryStringField="Id" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <div style="overflow: auto;">
                <asp:GridView ID="gvContractList" runat="server" AutoGenerateColumns="False" CssClass="List"
                    DataSourceID="odsData" OnRowUpdating="gvContractList_RowUpdating" DataKeyNames="Dev_FormatID"
                    PageSize="50" OnRowDataBound="gvContractList_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="Dev_FormatName" HeaderText="业态" ItemStyle-HorizontalAlign="Center"
                            ReadOnly="True">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="楼栋数">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbBuildingCount" runat="server" Text='<%# Bind("BuildingCount") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("BuildingCount") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="占地面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbZD_Area" runat="server" Text='<%# Bind("ZD_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("ZD_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="建筑面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbJZ_Area" runat="server" Text='<%# Bind("JZ_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("JZ_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="地上建筑面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbJZ_U_Area" runat="server" Text='<%# Bind("JZ_U_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("JZ_U_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="地下建筑面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbJZ_D_Area" runat="server" Text='<%# Bind("JZ_D_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("JZ_D_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="销售面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbXS_Area" runat="server" Text='<%# Bind("XS_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label6" runat="server" Text='<%# Bind("XS_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="地上销售面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbXS_U_Area" runat="server" Text='<%# Bind("XS_U_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%# Bind("XS_U_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="地下销售面积（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbXS_D_Area" runat="server" Text='<%# Bind("XS_D_Area") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label8" runat="server" Text='<%# Bind("XS_D_Area") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="混合面积A.5（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbMixArea" runat="server" Text='<%# Bind("MixArea") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("MixArea") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="混合面积D.2.1（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbMixAreaD2" runat="server" Text='<%# Bind("MixAreaD2") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label6" runat="server" Text='<%# Bind("MixAreaD2") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="混合面积D.2.3（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbMixAreaD3" runat="server" Text='<%# Bind("MixAreaD3") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%# Bind("MixAreaD3") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="混合面积D.6（m2）">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbMixAreaD6" runat="server" Text='<%# Bind("MixAreaD6") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label8" runat="server" Text='<%# Bind("MixAreaD6") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:CommandField ShowEditButton="True" ItemStyle-HorizontalAlign="Center" EditText="编缉"
                            CancelText="取消" UpdateText="更新">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:CommandField>
                        <asp:TemplateField HeaderText="备注">
                            <ItemTemplate>
                              <a href='javascript:ShowAreaHistory(<%# "\""+Request["id"]+"\",\""+Eval("Dev_FormatID").ToString()+"\"" %> );'>备注</a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle CssClass="cssFooter" />
                </asp:GridView>
            </div>
        </div>
        <asp:Button ID="btnSyncData" runat="server" Text="从开发大纲同步面积数据" OnClick="btnSyncData_Click"
            CssClass="op_menu_input" />
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="Server">
    <link href="../Resource/css/cs_stagearea.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function load() {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        }

        function EndRequestHandler() {
            $("input").keyup(function () {
                //alert($(this).val());
                if (isNaN($(this).val())) {
                    $(this).val("");
                    alert("不允许输入非数字");
                }
            });
        }
        function ShowAreaHistory(stageid,formatID) {

            if (formatID == "" || formatID == undefined) {
                alert("业态不存在");
                return;
            }


            var sUrl = "/Pages/StageAreaModifyHistory.aspx?id=" + encodeURI(stageid) + "&formatID=" + formatID;
            var sFeatures = "status:no;scroll:no;dialogWidth:620px;dialogHeight:400px;help:no;center:yes";
            var arg = showModalDialog(sUrl, "", sFeatures);

        }
    </script>
</asp:Content>
